變更於 2 分鐘前

HDR report

image alignment

search for optimal offset

process

  • change all the images into gray scale
    • Y=(54R + 183G + 19B)
  • compare two images, ignore the pixels that are close to threshold (threshold = 5)
  • scale by 1/2, recurse for 5 times.
  • each time, try 25 possibilities of offset, and find the best offset. By best, we means that the sum of abs(first_picture - second_picture) is minimized.

find response curve and radiance map

hat function

we made a class to represent the weight function. It has several method in it.

  • construct(self, Z) : pass in a flatten array to construct the function w
  • get_w_array(self, Z) : pass in a flatten array, return [w[z] for z in Z]

paul.d

response curve

  • build the matrix A and B by simply using a for loop, and solve it by using the numpy built in function x = np.linalg.lstsq(A, B, rcond=None). the matrix should look like this:

  • we tried several lambda. The response curve gets smoother as lambda increase, at last, we set lambda as 15.

radiance map

  • we use a for loop to loop through all images, and build a radiance map with shape of (height, width, 3). Then we print it out with matplotlib function. Note that the radiance is log.

robertson

response curve

  • we set the initial g as [0, 1/256, 2/256… 255/256]
  • then we find the E that fit the most, in this part we used matrix to compute all of the E at the same time.
    • Ei=j=1w(Zij)g(Zij)δtjw(Zij)δtj2
  • then with the E, we find another g, and in this part we also used matrix.
    • g(mi)=1EmijEmEiδtj
  • repeat for 7 times, then we get a response curve and radiance map.

radiance map

  • it is easier to construct the radiance map in robertson, since we had already know the radiance while computing the response curve. so we only has to modify it from the shape of (3, height, width) to (height, width, 3). It can simply be done by for loop.
  • note that the radiance has to be log.
  • but for some unknown reason, although the hdr is normal, there are some white patches in the blue radiance map.

tone mapping

global

(δ =1e-6)
(a = 0.01)

(Lwhite:max radiance)

local

  • store 13 pictures of different Gaussian filter size, find the max filter size for each pixel (Vs < ϵ) then combining 13 pictures to make a blured picture(Lsmaxblur)
  • make the final picture(Ld), Lm is same as Lm in global tone mapping

選擇 Repo